﻿#ifndef MAP_H
#define MAP_H

#include <QWidget>
#include<QWebChannel>
#include<QWebEnginePage>
#include <QPushButton>

#include"mapbridge.h"
namespace Ui {
class Map;
}

class Map : public QWidget
{
    Q_OBJECT

public:
    explicit Map(QWidget *parent = nullptr);
    ~Map();

private slots:

private:
    QWebChannel*channel;
    QWebEnginePage*page;

public:
    void InitMap();
    void setBoxPoint(double lng,double lat);
    void setBoxPoint1(double lng,double lat);
    void setCarPoint(double lng,double lat);
    void setDronePoint(double lng,double lat);
    void deleteBoxPoint();
    void deleteCarPoint();
    void deleteDronePoint();

    void setWay(double sLng,double sLat,double eLng,double eLat);

    void receiveRouteCoordinates(const QString &jsonStr);

public:
    QPushButton*gotoMain;
    mapBridge*bridge;
    bool load{false};

private:
    Ui::Map *ui;
};

#endif // MAP_H
